package json;

import org.json.JSONException;
import org.json.JSONObject;

public class JSONObjectTest {

	/**
	 * @param args
	 * @throws JSONException 
	 */
	public static void main(String[] args) throws JSONException {
		JSONObject jsonobj = new JSONObject("{'name':'zhaohui','age':24}");  
        String name = jsonobj.getString("name");  
        int age = jsonobj.getInt("age");  
        System.out.println(name+":"+age);  
        
        JSONObject ss=new JSONObject("{doc_id:'c640603010661ed9ad51f370',cid:'179',price:'0',doc_size:'352.3KB',doc_name:'侧方位停车图解教你侧方停车技巧',doc_type:'pdf',url:'http://wenku.baidu.com',wealth:parseInt('4'),level:parseInt('1'),isOrgDoc:'0',catal:'0',isAdmin:'',totalPageNum:'3',cid1:'form',cid2:'71',cid3:'179',cid4:'',owner:'赫海兔兔',useAsyncViewCount:'1',showAsyncViewCount:'1',showAsyncDownloadCount:'0',showAsyncValueCount:'0',showAsyncValueAverage:'0',viewCount:'34',value_average:'6',downloadCount:'5',valueCount:'2'}");
        System.out.println(ss.getInt("totalPageNum"));
	}

}
